<?php

include'../Classes/db.php'; 
include '../Classes/feedbackHandler.php';

$subgr=$_GET['subgr'];
$rel=$_GET['rel'];
$com=$_GET['com'];
$cdt=$_GET['cdy'];
$feed=$_GET['feed'];

$month=substr($cdt,3,2);
$year=substr($cdt,6,4);
$day=substr($cdt,0,2);
$cdy=$year."-".$month."-".$day;

$x=new DbConnect();
$con=$x->getConnection();

$feedback=new FeedbackHandler();
$feedback->setCon($con);

$time_now=mktime(date('H')+5,date('i')+30,date('s'),date('m'),date('d'),date('Y'));

 $yearnw=date('Y',$time_now); 
 $monthnw=date('m',$time_now); 
 $datenw=date('d',$time_now);


if (($year < $yearnw) || (($year == $yearnw)&&($month < $monthnw)) || (($year == $yearnw)&&($month = $monthnw)&&($day <= $datenw)))
		{
		$result=$feedback->feedbackAdd($subgr,$rel,$cdy,$com,$feed);
		echo $result;
		}
else
		{
		echo "Future Date !";
		}
?>